home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / pref / nsIRelativeFilePref.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  164 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIRelativeFilePref.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIRelativeFilePref_h__
  6. #define __gen_nsIRelativeFilePref_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsILocalFile; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIRelativeFilePref */
  21. #define NS_IRELATIVEFILEPREF_IID_STR "2f977d4e-5485-11d4-87e2-0010a4e75ef2"
  22.  
  23. #define NS_IRELATIVEFILEPREF_IID \
  24.   {0x2f977d4e, 0x5485, 0x11d4, \
  25.     { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 }}
  26.  
  27. /**
  28.  * The nsIRelativeFilePref interface is a wrapper for an nsILocalFile and
  29.  * and a directory service key. When used as a pref value, it stores a
  30.  * relative path to the file from the location pointed to by the directory
  31.  * service key. The path has the same syntax across all platforms.
  32.  *
  33.  * @see nsIPrefBranch::getComplexValue
  34.  * @see nsIPrefBranch::setComplexValue
  35.  * 
  36.  */
  37. class NS_NO_VTABLE nsIRelativeFilePref : public nsISupports {
  38.  public: 
  39.  
  40.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRELATIVEFILEPREF_IID)
  41.  
  42.   /**
  43.    * file
  44.    *
  45.    * The file whose location is stored or retrieved.
  46.    */
  47.   /* attribute nsILocalFile file; */
  48.   NS_IMETHOD GetFile(nsILocalFile * *aFile) = 0;
  49.   NS_IMETHOD SetFile(nsILocalFile * aFile) = 0;
  50.  
  51.   /**
  52.    * relativeToKey
  53.    *
  54.    * A directory service key for the directory
  55.    * from which the file path is relative.
  56.    */
  57.   /* attribute ACString relativeToKey; */
  58.   NS_IMETHOD GetRelativeToKey(nsACString & aRelativeToKey) = 0;
  59.   NS_IMETHOD SetRelativeToKey(const nsACString & aRelativeToKey) = 0;
  60.  
  61. };
  62.  
  63. /* Use this macro when declaring classes that implement this interface. */
  64. #define NS_DECL_NSIRELATIVEFILEPREF \
  65.   NS_IMETHOD GetFile(nsILocalFile * *aFile); \
  66.   NS_IMETHOD SetFile(nsILocalFile * aFile); \
  67.   NS_IMETHOD GetRelativeToKey(nsACString & aRelativeToKey); \
  68.   NS_IMETHOD SetRelativeToKey(const nsACString & aRelativeToKey); 
  69.  
  70. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  71. #define NS_FORWARD_NSIRELATIVEFILEPREF(_to) \
  72.   NS_IMETHOD GetFile(nsILocalFile * *aFile) { return _to GetFile(aFile); } \
  73.   NS_IMETHOD SetFile(nsILocalFile * aFile) { return _to SetFile(aFile); } \
  74.   NS_IMETHOD GetRelativeToKey(nsACString & aRelativeToKey) { return _to GetRelativeToKey(aRelativeToKey); } \
  75.   NS_IMETHOD SetRelativeToKey(const nsACString & aRelativeToKey) { return _to SetRelativeToKey(aRelativeToKey); } 
  76.  
  77. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  78. #define NS_FORWARD_SAFE_NSIRELATIVEFILEPREF(_to) \
  79.   NS_IMETHOD GetFile(nsILocalFile * *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(aFile); } \
  80.   NS_IMETHOD SetFile(nsILocalFile * aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFile(aFile); } \
  81.   NS_IMETHOD GetRelativeToKey(nsACString & aRelativeToKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeToKey(aRelativeToKey); } \
  82.   NS_IMETHOD SetRelativeToKey(const nsACString & aRelativeToKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRelativeToKey(aRelativeToKey); } 
  83.  
  84. #if 0
  85. /* Use the code below as a template for the implementation class for this interface. */
  86.  
  87. /* Header file */
  88. class nsRelativeFilePref : public nsIRelativeFilePref
  89. {
  90. public:
  91.   NS_DECL_ISUPPORTS
  92.   NS_DECL_NSIRELATIVEFILEPREF
  93.  
  94.   nsRelativeFilePref();
  95.  
  96. private:
  97.   ~nsRelativeFilePref();
  98.  
  99. protected:
  100.   /* additional members */
  101. };
  102.  
  103. /* Implementation file */
  104. NS_IMPL_ISUPPORTS1(nsRelativeFilePref, nsIRelativeFilePref)
  105.  
  106. nsRelativeFilePref::nsRelativeFilePref()
  107. {
  108.   /* member initializers and constructor code */
  109. }
  110.  
  111. nsRelativeFilePref::~nsRelativeFilePref()
  112. {
  113.   /* destructor code */
  114. }
  115.  
  116. /* attribute nsILocalFile file; */
  117. NS_IMETHODIMP nsRelativeFilePref::GetFile(nsILocalFile * *aFile)
  118. {
  119.     return NS_ERROR_NOT_IMPLEMENTED;
  120. }
  121. NS_IMETHODIMP nsRelativeFilePref::SetFile(nsILocalFile * aFile)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125.  
  126. /* attribute ACString relativeToKey; */
  127. NS_IMETHODIMP nsRelativeFilePref::GetRelativeToKey(nsACString & aRelativeToKey)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131. NS_IMETHODIMP nsRelativeFilePref::SetRelativeToKey(const nsACString & aRelativeToKey)
  132. {
  133.     return NS_ERROR_NOT_IMPLEMENTED;
  134. }
  135.  
  136. /* End of implementation class template. */
  137. #endif
  138.  
  139. #define NS_RELATIVEFILEPREF_CID                        \
  140.   { /* {2f977d4f-5485-11d4-87e2-0010a4e75ef2} */       \
  141.     0x2f977d4f,                                        \
  142.     0x5485,                                            \
  143.     0x11d4,                                            \
  144.     { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 } \
  145.   }
  146. #define NS_RELATIVEFILEPREF_CONTRACTID "@mozilla.org/pref-relativefile;1"
  147. #define NS_RELATIVEFILEPREF_CLASSNAME "Relative File Pref"
  148. #include "nsComponentManagerUtils.h"
  149. inline nsresult
  150. NS_NewRelativeFilePref(nsILocalFile* aFile, const nsACString& relativeToKey, nsIRelativeFilePref** result)
  151. {
  152.     nsresult rv;
  153.     nsCOMPtr<nsIRelativeFilePref> local(do_CreateInstance(NS_RELATIVEFILEPREF_CONTRACTID, &rv));
  154.     if (NS_FAILED(rv)) return rv;
  155.     
  156.     (void)local->SetFile(aFile);
  157.     (void)local->SetRelativeToKey(relativeToKey);
  158.     *result = local;
  159.     NS_ADDREF(*result);
  160.     return NS_OK;
  161. }
  162.  
  163. #endif /* __gen_nsIRelativeFilePref_h__ */
  164.